package tuxinjiemian;

import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

public class Demo1 extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;// 序列化是解决存储与传输的问题

	public Demo1() {
		setTitle("小白");
		setSize(500, 500);// 设置窗体大小
		setVisible(true);// 显示窗体
		setDefaultCloseOperation(EXIT_ON_CLOSE);// 关闭窗口并结束程序
		setLayout(new GridLayout(4, 5));
		//setLayout(new FlowLayout());
		for (int i = 0; i < 10; i++) {
			JButton bt = new JButton("按钮" + (i + 1));
			add(bt);
		}
		/*
		 * setLayout(null); JButton bt1=new JButton("东"); bt1.setBounds(30, 50,
		 * 100, 25); add(bt1);//设置布局 JButton bt2=new JButton("西");
		 * bt2.setSize(50,25); bt2.setLocation(30,100); add(bt2);
		 */
		/*
		 * JButton bt3=new JButton("南"); add(bt3,BorderLayout.SOUTH); JButton
		 * bt4=new JButton("北"); add(bt4,BorderLayout.NORTH); JLabel ss=new
		 * JLabel("xiaobai"); add(ss,BorderLayout.CENTER);
		 */

	}

	public static void main(String[] args) {
		new Demo1();// 匿名实例化
		/*
		 * Object[] s=getFrames(); System.out.println(s);
		 */
         //哈哈哈哈哈哈哈哈
	}
}